"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const react_navigation_redux_helpers_1 = require("react-navigation-redux-helpers");
const react_navigation_1 = require("react-navigation");
const react_redux_1 = require("react-redux");
const test_1 = require("../rn_pages/test");
const test2_1 = require("../rn_pages/test2");
exports.AppRouteConfig = {
    Home: { screen: test_1.default },
    Test2: { screen: test2_1.default },
};
const stackConfig = {
    mode: 'card',
    headerMode: 'none',
    gesturesEnabled: false,
    // gestureResponseDistance: { horizontal: 10 },
    transitionConfig: () => ({
        screenInterpolator: (sceneProps) => {
            const { layout, position, scene } = sceneProps;
            const { index, route } = scene;
            const translateX = position.interpolate({
                inputRange: [index - 1, index, index + 1],
                outputRange: [layout.initWidth, 0, 0],
            });
            const opacity = position.interpolate({
                inputRange: [index - 1, index - 0.99, index, index + 0.99, index + 1],
                outputRange: [0, 0.3, 1, 0.3, 0],
            });
            if (route) {
                //TODO:alert开头的其他操作
                // if (
                //     (route.routeName == RoomRoute)
                //     // || (route.routeName == 房间主页)
                // ) {
                //     return { opacity };
                // }
            }
            return { opacity, transform: [{ translateX }] };
        },
    }),
};
exports.AppStack = react_navigation_1.createStackNavigator(exports.AppRouteConfig, stackConfig);
function getAppStackComponent() {
    return react_redux_1.connect((state) => ({ state: state.ui.nav }))(react_navigation_redux_helpers_1.reduxifyNavigator(exports.AppStack, 'root'));
}
exports.getAppStackComponent = getAppStackComponent;
